<html>
<body>

<p> This is the site for Fontys Tennis club</p>

<?php

// db config
$db_server = "localhost";
$username = "jan";
$password = "SPmKC66YX6w9WYFc";  

// database connection object
$con;

// check if db exsist
function connectToDatabase()
{
	echo "<p>1) connecting to db</p>";

	// create access for global variables
	global $db_server, $username, $password, $con;
	//echo "<p>db username:" . $username . ", db pass: " . $password . "</p>";

	$con = mysql_connect($db_server, $username, $password);
	if (!$con)
	{
		echo "<p>Connection to db was unsuccessfull.";	
	} else {
		echo "<p>2) connection is established</p>";
	}
	
}

connectToDatabase();

function checkIfDatabaseExist()
{
	// check if connection to db exist
	global $con;
	if ( $con == "" ) 
	{
		echo "<p>error: can't find db connection object </p>";
		return;
	} 

	// check if tennis db exist
	echo "next step";
	
}

checkIfDatabaseExist();


// create db if it does not exist

// get info from db

// provide functions to add to db

// provide functions to get information from db

// provide functions to modify existing db


?>

</body>
</html> 